// Copyright (c) 2015-present, salesforce.com, inc. All rights reserved
// Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license

/**
 * @summary Initializes a publisher
 *
 * @name base
 * @selector .slds-publisher
 * @restrict div
 * @support dev-ready
 * @variant
 */
.slds-publisher {
  display: flex;

  /**
   * @selector .slds-is-active
   * @restrict .slds-publisher
   * @modifier
   */
  &.slds-is-active {
    display: block;

    .slds-publisher__toggle-visibility {
      display: inherit;
      height: auto;
      overflow: visible;
      width: auto;
    }

    .slds-publisher__input {
      line-height: $line-height-text;
      height: auto;
      max-height: 10rem;
      resize: vertical;
      padding: {
        top: $spacing-small;
        bottom: $spacing-small;
      }
    }
  }

  /**
   *
   *
   * @selector .slds-publisher__toggle-visibility
   * @restrict .slds-publisher label, .slds-publisher ul
   * @required
   */
  .slds-publisher__toggle-visibility {
    display: block;
    height: 0;
    overflow: hidden;
    width: 0;
  }
}

/**
  * Abstraction of the text input styles
  *
  * @selector .slds-publisher__input
  * @restrict .slds-publisher textarea
  * @required
  */
.slds-publisher__input {
  line-height: $line-height-button;
  padding: 0 $spacing-medium;
  resize: none;
  max-height: calc(#{$line-height-button} + 2px);
  width: 100%;
  border-radius: $border-radius-medium;
}

/**
  * Bottom row of actionable items
  *
  * @selector .slds-publisher__actions
  * @restrict .slds-publisher div
  * @required
  */
.slds-publisher__actions > .slds-button {
  margin-left: $spacing-small;
}
